package com.cedifie.lendapp.ui.loan.adapter

import android.annotation.SuppressLint
import androidx.recyclerview.widget.RecyclerView
import com.cedifie.lendapp.R
import com.cedifie.lib_baseadapter.CEDRecyclerViewAdapter
import com.cedifie.lib_baseadapter.CEDViewHolderHelper
import org.json.JSONObject

/**
 * Cedifie
 * @Author wwdeng
 * @CreateTime: 2024/4/24 14:42
 * @Annotation：还款明细适配器
 */
class CedLoanRepayLableAdapter(recyclerView: RecyclerView?) : CEDRecyclerViewAdapter<JSONObject>(recyclerView, R.layout.item_loan_repay_lable) {
    override fun setItemChildListener(helper: CEDViewHolderHelper, viewType: Int) {
        helper.setItemChildClickListener(R.id.itemLayout) //点击Item
    }

    @SuppressLint("SetTextI18n")
    override fun fillData(helper: CEDViewHolderHelper, position: Int, model: JSONObject) {
        val textTitle = helper.getTextView(R.id.textTitle)
        textTitle.text = model.optString("showName")

        val textValue = helper.getTextView(R.id.textValue)
        textValue.text = model.optString("showDetail")
    }
}